package www.reagnetbox.com.view;

import android.content.Context;
import android.widget.EditText;
import android.widget.TextView;

import com.blankj.utilcode.util.SPUtils;
import com.lxj.xpopup.core.CenterPopupView;
import com.lxj.xpopup.util.XPopupUtils;

import www.reagnetbox.com.R;
import www.reagnetbox.com.callback.SimpleCallback;

public class SettingPopup extends CenterPopupView {
    Context context;

    public SettingPopup(Context context ) {
        super(context);
        this.context=context;
    }

    @Override
    protected int getImplLayoutId() {
        return R.layout.popup_setting;
    }


    @Override
    protected void onCreate() {
        super.onCreate();
        SPUtils spInstance = SPUtils.getInstance();

        EditText etIp = findViewById(R.id.et_ip);
        etIp.setText(spInstance.getString("ip"));

        EditText etPort = findViewById(R.id.et_port);
        etPort.setText(spInstance.getString("port"));

        EditText etDeviceName = findViewById(R.id.et_device_name);
        etDeviceName.setText(spInstance.getString("device_name"));

        EditText etDays = findViewById(R.id.et_days);
        etDays.setText(spInstance.getString("days"));

        EditText etLimsAddress = findViewById(R.id.et_lims_address);
        etLimsAddress.setText(spInstance.getString("lims_address"));

        findViewById(R.id.tv_back).setOnClickListener(v -> dismiss());
        findViewById(R.id.tv_save).setOnClickListener(v -> {
        });
    }
}
